package net.timico.messaging;

import javax.jms.JMSException;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;

import org.apache.activemq.ActiveMQConnectionFactory;

/** 
 * This type describes the activeMQ Broker.
 * <p>
 * 
 * @author $Author: sleroy $
 * @since 1 oct. 2011
 * @copyright Copyright (C) 2010-2012 TOCEA
 */

public class ActiveMQApp
{
    
    public static void main(final String[] args) {
    
        // Create a ConnectionFactory
        final ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://192.168.100.50:61616");
        
        // Create a Connection
        TopicConnection connection;
        try {
            connection = connectionFactory.createTopicConnection();
            connection.start();
            
            // Create a Session
            final TopicSession session = connection.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
           
            //session.createQueue("test");
            session.createTopic("public");
            
        } catch (final JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
